<template>
	<view class="more">
		<view class="persons">
			<view class="person" v-for="item in CleanerList" :key="item.id" @click="ToCleaner(item.id)">
				<view class="top">
					<image class="img" :src="item.image" />
					<view class="img-icon">
						<view class="img-icon-one">
							<u-icon name="map-fill" size="22rpx" top="1rpx"></u-icon>
							<text class="maptxt">{{(item.distance / 1000).toFixed(1)}}km</text>
						</view>
						<view class="img-icon-two">
							<u-icon name="heart" size="30rpx" v-if="item.is_collection == 0"></u-icon>
							<u-icon name="heart-fill" size="30rpx" color="red" v-else></u-icon>
						</view>
					</view>
				</view>

				<view class="bottom">
					<view class="bottom-top">
						<view class="bottom-left">
							<view class="name">{{item.name}}</view>
							<view class="age">{{item.age}}岁</view>
						</view>
						<view class="bottom-right">
							<view class="bottom-right-one">今日可约</view>
							<view class="bottom-right-two">{{item.works_times}}</view>
						</view>
					</view>
					<view class="bottom-end">{{item.type}}</view>
				</view>

			</view>
		</view>
	</view>
</template>

<script>
	import { ResCleanerList } from '@/untils/api.js'
	export default {
		data() {
			return {
				CleanerList: [],
			}
		},
		onShow() {
			this.getCleanerList()
		},
		methods: {
			async getCleanerList() {
				const { data: res } = await ResCleanerList()
				this.CleanerList = res.data.data
				console.log(res, '技师列表');
			},
			ToCleaner(id) {
				uni.navigateTo({
					url: `/pages/Home/Cleaner?id=${id}`
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.more {
		padding: 40rpx 24rpx;
		box-sizing: border-box;
	}

	.more .persons {
		width: 100%;
		height: 100%;
		display: flex;
		flex-wrap: wrap;
		justify-content: space-between;
	}

	.more .persons .person {
		width: 346rpx;
		height: 472rpx;
		background: #FFFFFF;
		box-shadow: 0rpx 2rpx 12rpx 0rpx rgba(0, 0, 0, 0.11);
		border-radius: 18rpx;
		margin-bottom: 15rpx;
	}

	.more .persons .person .top {
		width: 346rpx;
		height: 343rpx;
		border-radius: 18rpx 18rpx 0rpx 0rpx;
		background-color: #4dadca;
		position: relative;
	}

	.more .persons .person .top .img {
		width: 346rpx;
		height: 343rpx;
	}


	.img-icon {
		width: 100%;
		display: flex;
		justify-content: space-between;
		align-items: center;
		position: absolute;
		bottom: 24rpx;
		left: 0;
		padding: 0 20rpx;
		color: #fff;
		font-size: 20rpx;
		;
		box-sizing: border-box;

		.img-icon-one {
			height: 32rpx;
			line-height: 32rpx;
			padding: 0 10rpx;
			background-color: #000000;
			opacity: 0.5;
			border-radius: 20rpx;
			display: flex;
			color: #fff;

			.maptxt {
				margin-left: 5rpx;
			}
		}

		.img-icon-two {
			width: 44rpx;
			height: 44rpx;
			background-color: #000000;
			opacity: 0.5;
			border-radius: 50rpx;
			text-align: center;
			line-height: 54rpx;
		}
	}

	.more .persons .person .bottom {
		height: 129rpx;
		padding: 10rpx;
		box-sizing: border-box;
	}

	.more .persons .person .bottom .bottom-top {
		width: 100%;
		height: 41rpx;
		display: flex;
		justify-content: space-between;
		align-items: center;
	}

	.more .persons .person .bottom .bottom-top .bottom-left {
		display: flex;
		// justify-content: space-between;
		align-items: baseline;
	}

	.more .persons .person .bottom .bottom-top .bottom-left .name {
		width: 93rpx;
		font-size: 30rpx;
		font-family: PingFangSC-Medium, PingFang SC;
		font-weight: 500;
		color: #080808;
		// margin-right: 5rpx;
	}

	.more .persons .person .bottom .bottom-top .bottom-left .age {
		// width: 55rpx;
		font-size: 24rpx;
		font-family: PingFangSC-Regular, PingFang SC;
		font-weight: 400;
		color: #040404;
	}

	.bottom-right {
		width: 145rpx;
		height: 32rpx;
		font-size: 20rpx;
		border: 1px solid #01C3A8;
		color: #01C3A8;
		border-radius: 6rpx;
		overflow: hidden;
		display: flex;
		padding: 0;



		.bottom-right-one {
			width: 84rpx;
			height: 30rpx;
			text-align: center;
			background-color: #01C3A8;
			color: #fff;
		}

		.bottom-right-two {
			width: 58rpx;
			height: 30rpx;
			text-align: center;
		}
	}





	.more .persons .person .bottom .bottom-end {
		// width: 125rpx;
		height: 32rpx;
		display: flex;
		font-size: 24rpx;
		font-family: PingFangSC-Regular, PingFang SC;
		font-weight: 400;
		color: #919191;
		line-height: 33rpx;
		margin-top: 15rpx;
	}
</style>
